--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 90ffd63aded3803a749fb5fb5f00fc1a63c2edf2
Parents : fc2f770
Author : Ivan <ivan@quad4.io>
Signature : Invalid signer <e46112d44649266d71fe2193e00a4710>, author is <ivan@quad4.io>
Date : 2026-07-08T10:07:12-05:00
feat(DialogUtils): add confirmCustom method for themed in-app confirmation dialogs
Changes
2 files changed, 10 insertions(+), 2 deletions(-)
Diff
diff --git a/meshchatx/src/frontend/components/relay/RelayChatPage.vue b/meshchatx/src/frontend/components/relay/RelayChatPage.vue
index a4dff283..51f13a1f 100644
--- a/meshchatx/src/frontend/components/relay/RelayChatPage.vue
+++ b/meshchatx/src/frontend/components/relay/RelayChatPage.vue
@@ -1682,7 +1682,7 @@ export default {
await this.leaveRoom();
return;
}
- const confirmed = await DialogUtils.confirm(this.$t("relay_chat.leave_room_confirm"));
+ const confirmed = await DialogUtils.confirmCustom(this.$t("relay_chat.leave_room_confirm"));
if (!confirmed) {
return;
}
@@ -2102,7 +2102,7 @@ export default {
if (!this.selectedHub || !this.selectedRoom) {
return;
}
- const confirmed = await DialogUtils.confirm(this.$t("relay_chat.leave_room_confirm"));
+ const confirmed = await DialogUtils.confirmCustom(this.$t("relay_chat.leave_room_confirm"));
if (!confirmed) {
return;
}
diff --git a/meshchatx/src/frontend/js/DialogUtils.js b/meshchatx/src/frontend/js/DialogUtils.js
index 330c823b..4ddede80 100644
--- a/meshchatx/src/frontend/js/DialogUtils.js
+++ b/meshchatx/src/frontend/js/DialogUtils.js
@@ -23,6 +23,14 @@ class DialogUtils {
}
}
+ // Always use the in-app confirm dialog, even inside electron, for
+ // callers that want a themed dialog instead of the native OS prompt.
+ static confirmCustom(message) {
+ return new Promise((resolve) => {
+ GlobalEmitter.emit("confirm", { message, resolve });
+ });
+ }
+
static async prompt(message) {
if (window.electron) {
// running inside electron, use ipc prompt
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────